package com.breadenglish.cms.api.app.sys.context;


import com.breadenglish.cms.api.app.domain.model.ResultMessage;

/**
 * 异常上下文对象
 */
public class MessageContextHolder {

    private static final ThreadLocal<ResultMessage> localResultMessage = new ThreadLocal<ResultMessage>();

    public static void setExceptionJson(ResultMessage exceptionJson) {
        localResultMessage.set(exceptionJson);
    }

    public static ResultMessage getResultMessage() {
        return localResultMessage.get();
    }

    public static void removeResultMessage() {
        localResultMessage.remove();
    }

}
